{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## Language servers\n", "\n", "By default `jupyter-lsp` does not come with any language servers preinstalled.\n", "However, we will try to use them if they _are_ installed and we know about them\n", "(i.e. someone contributed a full specification).\n", "\n", "> You can disable auto-detection by configuring\n", "> [autodetect](./Configuring.html#autodetect)\n", "\n", "You can add another language server for languages that are not listed on this\n", "page:\n", "\n", "- using a minimal JSON or Python\n", " [configuration file](./Configuring.html#language-servers) (good for\n", " experimenting or configuring a niche server), or\n", "- contributing a [full specification](./Contributing.html#specs) (to enable\n", " better integration and help other users of the same language)\n", "\n", "The existing language servers are listed on the [official\n", "list][lsp-implementations] and on the [community-curated list][langserver].\n", "\n", "For the language servers in the tables below, use one of the suggested package\n", "managers to install them: these implementations are tested to work with\n", "`jupyter-lsp`.\n", "\n", "[language-server]:\n", " https://microsoft.github.io/language-server-protocol/specification\n", "[langserver]: https://langserver.org\n", "[lsp-implementations]:\n", " https://microsoft.github.io/language-server-protocol/implementors/servers" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "tags": [ "remove-cell" ] }, "outputs": [], "source": [ "import pathlib\n", "\n", "import IPython\n", "from jinja2 import Template\n", "\n", "from jupyter_lsp import LanguageServerManager" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "tags": [ "remove-cell" ] }, "outputs": [], "source": [ "mgr = LanguageServerManager(extra_node_roots=[str(pathlib.Path.cwd().parent)])" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "tags": [ "remove-cell" ] }, "outputs": [], "source": [ "mgr.init_language_servers()" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "tags": [ "remove-cell" ] }, "outputs": [], "source": [ "def lang_server_table(specs):\n", " return IPython.display.HTML(\n", " Template(\n", " \"\"\"\n", "
Languages | \n", "Implementation | \n", "Installation | \n", "
---|---|---|
\n",
" {% for lang in spec.languages %}\n",
" {{ lang }} \n", " {% endfor %}\n", " | \n",
" \n", " {{key}}\n", " | \n", "\n",
"
| \n",
"
{{ spec.troubleshoot }}
\n", " {% endfor %}\n", " \"\"\"\n", " ).render(specs=troubleshooting_data)\n", ")" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.9" } }, "nbformat": 4, "nbformat_minor": 4 }